Face Matching v4
Requirements
- The input image size does not exceed 5 MB and the minimum resolution is approximately 640x480 to ensure the confident rate.
 - The ratio of face area must be at least ¼ of the total image area.
 - Extension must be jpg/jpeg
 
Request
Request Url
POST https://api.fpt.ai/vision/ekyc/facematch/v4/
Request Headers
| Parameter | Required | Default | Description | 
|---|---|---|---|
| api_key | Yes | Your api key ( get from console.fpt.ai ) | 
Request Body
FormData contain 2 images that need to be checked
| Parameter | Required | Description | 
|---|---|---|
| file[] | Yes | |
| file[] | Yes | |
| validate | Optional | Check quality of face (wearing mask, cutting face, ...) | 
Note: append "file[]" 2 times in form data
Sample Request
curl --location --request POST 'https://api.fpt.ai/vision/ekyc/facematch/v4' \
--header 'api_key: xxxxxxxxxxxxxxxx' \
--form 'file[]=@"/image1.jpg"' \
--form 'file[]=@"/image2.png"'
Sample Request with check quality of face
curl --location --request POST 'https://api.fpt.ai/vision/ekyc/facematch/v4' \
--header 'api_key: xxxxxxxxxxxxxxxx' \
--form 'file[]=@"/image1.jpg"' \
--form 'file[]=@"/image2.png"' \
--form 'validate="true"'
Response
JSON
isMatch: indicate 2 images are the same or not (base on a threshold of 80%)similarity: how similar is one image to anotherisBothImgIDCard: indicate 2 images are both image of ID card
{
    "code" : "200",
    "data" : {
        "isMatch": false,
        "similarity": 21.25160789489746,
        "isBothImgIDCard": false
    },
    "message": "request successful."
}
Response Code
| Code | Meaning | 
|---|---|
| 200 | Success | 
| 406 | Photo not contains full face, too close; wearing mask, sunglasses or hat | 
| 407 | No faces/more than 1 face detected | 
| 408 | Invalid data (wrong extension, wrong mime types) | 
| 409 | More or less than 2 images for face check | 
Sample Response: Success
{
    "code" : "200",
    "data" : {
        "isMatch": false,
        "similarity": 21.25160789489746,
        "isBothImgIDCard": false
    },
    "message": "request successful."
}
Sample Response: Error
{
    "code": "409",
    "data": "Please upload only 2 images for face check",
    "message": "request successful."
}
{
    "code": "408",
    "data": "Allowed mime types are image/jpeg, image/png",
    "message": "request successful."
}
{
    "code": "407",
    "data": "No faces detected",
    "message": "request successful."
}